<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%kj_record}}".
 *
 * @property string $id
 * @property integer $goods_id
 * @property integer $user_id
 * @property integer $cat_id
 * @property integer $bid
 * @property double $bargainprice
 * @property double $leftprice
 * @property integer $createtime
 */
class KjRecord extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%kj_record}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['goods_id', 'cat_id', 'bid'], 'required'],
            [['goods_id', 'user_id', 'cat_id', 'bid', 'createtime'], 'integer'],
            [['bargainprice', 'leftprice'], 'number'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'goods_id' => '商品id',
            'user_id' => '用户id，为空时系统帮砍的',
            'cat_id' => '商品分类id',
            'bid' => '发起砍价表id',
            'bargainprice' => '砍掉的金额数',
            'leftprice' => '剩余金额数',
            'createtime' => 'Createtime',
        ];
    }
}
